/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package Controller;

import View.*;
import DAO.*;
import TO.AuthorTO;

/**
 *
 * @author admin-pc
 */
public class AuthorController implements AuthorListener{
    
    private View view;
    private Model model;
    
    DAOFactory daof = DAOFactory.getInstance();
    
    public AuthorController(View view, Model model) {
		this.view = view;
		this.model = model;
    }
    
    public void authorAdd(AuthorEvent event){
        daof.getAuthorDAO().add(new AuthorTO(event.getId(),event.getName()));
    }
    public void authorDelete(AuthorEvent event){
        daof.getAuthorDAO().delete(event.getId());
    };
    public void authorUpdate(AuthorEvent event){
        daof.getAuthorDAO().update(new AuthorTO(event.getId(),event.getName()));
    };
    
}
